<template>
    <div class="Askto">
        <van-nav-bar :title="housetpye" left-text="返回" left-arrow @click-left="onClickLeft" />
        <van-dropdown-menu>
            <van-dropdown-item v-model="value1" :options="option1" />
            <van-dropdown-item v-model="value2" :options="option2" />
        </van-dropdown-menu>
        <div class="con">
            <div class="con-item" v-for="(item, index) in data" :key="index">
                <div class="con-item-top">
                    <div class="left">
                        <span>{{ item.name }}</span>
                    </div>
                    <div class="right">
                        <span>{{ item.time }}</span>
                    </div>
                </div>
                <div class="con-item-con">
                    {{ item.text }}{{ housetpye }}
                </div>
                <div class="con-item-bom">
                    <div class="left">
                        <span>所在区域：{{ item.ress }}</span>
                        <span>价格：<span>{{ item.price }}/月</span></span>
                    </div>
                    <div class="right">
                        <span>
                            <van-icon name="comment-circle" size="25" @click="ToMeassage"/>
                            <van-icon name="phone-circle" size="25" />
                        </span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import {useRouter} from 'vue-router';
import data from './data/data.json';
const { housetpye } = defineProps(['housetpye']);
const Router = useRouter();

const onClickLeft = () => history.back();

const value1 = ref(0);
const value2 = ref('a');
const option1 = [
    { text: '房产类型', value: 0 },
    { text: '多层住宅', value: 1 },
    { text: '高层住宅', value: 2 },
    { text: '小高层住宅', value: 3 },
    { text: '商铺/门面房', value: 4 },
    { text: '厂房', value: 5 },
    { text: '写字楼', value: 6 },
    { text: '独院/别墅', value: 7 },
    { text: '车库', value: 8 },
];
const option2 = [
    { text: '区域选择', value: 'a' },
    { text: '海淀区', value: 'b' },
    { text: '朝阳区', value: 'c' },
    { text: '丰台区', value: 'd' },
    { text: '大兴区', value: 'e' },
    { text: '丰台区', value: 'f' },
    { text: '延庆区', value: 'g' },
    { text: '昌平区', value: 'h' },
    { text: '平谷区', value: 'i' },
];

const ToMeassage = ()=>{
    Router.push('/message')
}
</script>


<style scoped lang="scss">
.Askto {
    width: 100%;
    height: auto;
    .con {
        width: 100%;
        min-height: 550px;
        display: flex;
        flex-direction: column;
        background: #F2F2F2;

        .con-item {
            width: 98%;
            height: 150px;
            margin: 10px auto;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            background: #fff;

            .con-item-top {
                width: 100%;
                height: 33%;

                display: flex;
                align-items: center;
                justify-content: space-around;

                .left {
                    width: 30%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                }

                .right {
                    width: 70%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: right;

                    span {
                        display: flex;
                        margin-right: 15px;
                        font-size: 12px;
                    }
                }

            }

            .con-item-con {
                width: 100%;
                height: 33%;
                display: flex;
                align-items: center;
                padding-left: 5px;
            }

            .con-item-bom {
                width: 100%;
                height: 33%;
                display: flex;
                align-items: center;
                justify-content: space-around;
                font-size: 10px;

                .left {
                    width: 50%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;

                    >span {
                        display: flex;
                        margin-right: 10px;
                        align-items: center;
                        justify-content: center;

                        span {
                            color: red;
                        }
                    }

                }

                .right {
                    width: 50%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    .van-icon{
                        margin-left: 20px;
                    }
                }
            }
        }
    }
}
</style>